/******************************************************************************

	COPYRIGHT(C) JONAS 'SORTIE' TERMANSEN 2009, 2010.

	This file is part of Maxsi Engine.

	Maxsi Engine is free software: you can redistribute it and/or modify it
	under the terms of the GNU Lesser General Public License as published by
	the Free Software Foundation, either version 3 of the License, or (at your
	option) any later version.

	Maxsi engine is distributed in the hope that it will be useful, but WITHOUT
	ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
	FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
	for more details.

	You should have received a copy of the GNU Lesser General Public License
	along with Maxsi Engine. If not, see <http://www.gnu.org/licenses/>.

	MaxsiEngine.dll
	A general purpose C++ library for the Maxsi Technology Project.

	MaxsiWin7TaskBar.h
	Functions to enable features introduced by Win7 without breaking
	compatibility with previous versions of Windows.

******************************************************************************/

#ifndef MaxsiWin7TaskBar_H
#define MaxsiWin7TaskBar_H

#include <commctrl.h>

BeginMaxsiNamespace

#define __RPC__in
#define __RPC__in_opt
#define __RPC__in_opt_string
#define __RPC__in_ecount_full(x)
#define DEFINE_ENUM_FLAG_OPERATORS(x)

//EXTERN_C const CLSID CLSID_TaskbarList;

typedef struct tagTHUMBBUTTON
{
	DWORD dwMask;
	UINT iId;
	UINT iBitmap;
	HICON hIcon;
//	WCHAR pszTip[ 260 ];
	wchar_t pszTip[ 260 ];
	DWORD dwFlags;
} THUMBBUTTON;

typedef struct tagTHUMBBUTTON *LPTHUMBBUTTON;

#ifndef __ITaskbarList_INTERFACE_DEFINED__
#define __ITaskbarList_INTERFACE_DEFINED__

EXTERN_C const IID IID_ITaskbarList;

MIDL_INTERFACE("56FDF342-FD6D-11d0-958A-006097C9A090")
ITaskbarList : public IUnknown
{
public:
	virtual HRESULT STDMETHODCALLTYPE HrInit( void) = 0;
	virtual HRESULT STDMETHODCALLTYPE AddTab(__RPC__in HWND hwnd) = 0;
	virtual HRESULT STDMETHODCALLTYPE DeleteTab(__RPC__in HWND hwnd) = 0;
	virtual HRESULT STDMETHODCALLTYPE ActivateTab(__RPC__in HWND hwnd) = 0;
	virtual HRESULT STDMETHODCALLTYPE SetActiveAlt(__RPC__in HWND hwnd) = 0;
};

#endif 	/* __ITaskbarList_INTERFACE_DEFINED__ */


#ifndef __ITaskbarList2_INTERFACE_DEFINED__
#define __ITaskbarList2_INTERFACE_DEFINED__

EXTERN_C const IID IID_ITaskbarList2;

MIDL_INTERFACE("602D4995-B13A-429b-A66E-1935E44F4317")
ITaskbarList2 : public ITaskbarList
{
public:
	virtual HRESULT STDMETHODCALLTYPE MarkFullscreenWindow(__RPC__in HWND hwnd, BOOL fFullscreen) = 0;

};

#endif 	/* __ITaskbarList2_INTERFACE_DEFINED__ */

#ifndef __ITaskbarList3_INTERFACE_DEFINED__
#define __ITaskbarList3_INTERFACE_DEFINED__

/* interface ITaskbarList3 */
/* [object][uuid] */ 

typedef /* [v1_enum] */ 
enum TBPFLAG
{
	TBPF_NOPROGRESS	= 0,
	TBPF_INDETERMINATE	= 0x1,
	TBPF_NORMAL	= 0x2,
	TBPF_ERROR	= 0x4,
	TBPF_PAUSED	= 0x8
} TBPFLAG;

DEFINE_ENUM_FLAG_OPERATORS(TBPFLAG)

//EXTERN_C const IID IID_ITaskbarList3;
const GUID 	IID_ITaskbarList3 = {0xea1afb91, 0x9e28, 0x4b86, {0x90, 0xe9, 0x9e, 0x9f, 0x8a, 0x5e, 0xef, 0xaf}};

MIDL_INTERFACE("ea1afb91-9e28-4b86-90e9-9e9f8a5eefaf")
ITaskbarList3 : public ITaskbarList2
{
public:
virtual HRESULT STDMETHODCALLTYPE SetProgressValue( 
/* [in] */ __RPC__in HWND hwnd,
/* [in] */ ULONGLONG ullCompleted,
/* [in] */ ULONGLONG ullTotal) = 0;

virtual HRESULT STDMETHODCALLTYPE SetProgressState( 
/* [in] */ __RPC__in HWND hwnd,
/* [in] */ TBPFLAG tbpFlags) = 0;

virtual HRESULT STDMETHODCALLTYPE RegisterTab( 
/* [in] */ __RPC__in HWND hwndTab,
/* [in] */ __RPC__in HWND hwndMDI) = 0;

virtual HRESULT STDMETHODCALLTYPE UnregisterTab( 
/* [in] */ __RPC__in HWND hwndTab) = 0;

virtual HRESULT STDMETHODCALLTYPE SetTabOrder( 
/* [in] */ __RPC__in HWND hwndTab,
/* [in] */ __RPC__in HWND hwndInsertBefore) = 0;

virtual HRESULT STDMETHODCALLTYPE SetTabActive( 
/* [in] */ __RPC__in HWND hwndTab,
/* [in] */ __RPC__in HWND hwndMDI,
/* [in] */ DWORD dwReserved) = 0;

virtual HRESULT STDMETHODCALLTYPE ThumbBarAddButtons( 
/* [in] */ __RPC__in HWND hwnd,
/* [in] */ UINT cButtons,
/* [size_is][in] */ __RPC__in_ecount_full(cButtons) LPTHUMBBUTTON pButton) = 0;

virtual HRESULT STDMETHODCALLTYPE ThumbBarUpdateButtons( 
/* [in] */ __RPC__in HWND hwnd,
/* [in] */ UINT cButtons,
/* [size_is][in] */ __RPC__in_ecount_full(cButtons) LPTHUMBBUTTON pButton) = 0;

virtual HRESULT STDMETHODCALLTYPE ThumbBarSetImageList( 
/* [in] */ __RPC__in HWND hwnd,
/* [in] */ __RPC__in_opt HIMAGELIST himl) = 0;

virtual HRESULT STDMETHODCALLTYPE SetOverlayIcon( 
/* [in] */ __RPC__in HWND hwnd,
/* [in] */ __RPC__in HICON hIcon,
/* [string][unique][in] */ __RPC__in_opt_string LPCWSTR pszDescription) = 0;

virtual HRESULT STDMETHODCALLTYPE SetThumbnailTooltip( 
/* [in] */ __RPC__in HWND hwnd,
/* [string][unique][in] */ __RPC__in_opt_string LPCWSTR pszTip) = 0;

virtual HRESULT STDMETHODCALLTYPE SetThumbnailClip( 
/* [in] */ __RPC__in HWND hwnd,
/* [in] */ __RPC__in RECT *prcClip) = 0;

};

#endif 	/* __ITaskbarList3_INTERFACE_DEFINED__ */

LINK bool EnableWin7TaskBar(HWND hwnd);
LINK bool Win7TaskBarSetState(HWND hwnd, TBPFLAG tbpFlags);
LINK bool Win7TaskBarSetProgress(HWND hwnd, ULONGLONG ullCompleted, ULONGLONG ullTotal);

extern DWORD g_Win7TBC;

EndMaxsiNamespace

#endif
